import 'package:flutter/cupertino.dart';
import 'package:flutter_base/http/api.dart';

import '../../bean/hot/search/search_result_entity.dart';

///
/// @DIR_PATH：lib/viewmodel/hot
/// @TIME：2024/6/13 19:51
/// @AUTHOR：starr
/// 搜索
class SearchViewModel with ChangeNotifier{

  //article/query/0/json
  List<SearchResultDatas>? searchList = [];

  Future search(String? keyword) async {
    searchList = await Api.instance.search(keyword ?? "");
    notifyListeners();
  }

  void clear(){
    searchList?.clear();
    notifyListeners();
  }
}